package cn.zhuht.demo;

import cn.zhuht.jdk8test.util.ImageUtil;

import java.io.IOException;
import java.util.ArrayList;

/**
 * @author zhuhaitao
 * @date 2019/8/28 19:12
 */
public class ImageUtilTest {
  public static void main(String[] args) {
    String dir = "E:\\avatar";
    String groupId = "08282019";
    ArrayList<String> picUrls = new ArrayList<>();
//    picUrls.add("C:\\Users\\zhuhaitao\\Pictures\\Camera Roll\\_uploads_allimg_170919_95-1F919160J4.jpg");
//    picUrls.add("C:\\Users\\zhuhaitao\\Pictures\\Camera Roll\\_uploads_allimg_170919_95-1F919160J7.jpg");
//    picUrls.add("C:\\Users\\zhuhaitao\\Pictures\\Camera Roll\\_uploads_allimg_180117_95-1P11G42U2.jpg");
//    picUrls.add("C:\\Users\\zhuhaitao\\Pictures\\Camera Roll\\1557366018156.jpg");
//    picUrls.add("C:\\Users\\zhuhaitao\\Pictures\\Camera Roll\\下载.png");

//    picUrls.add("https://www.baidu.com/link?url=En36UlXgWo1lAvhSc2Rsvmo-FYh_fGj3qbLd6OCwQCJyfVivDcB_mLGrQYBF87spsvum_8pDOp3pTK82eVZ9EzF3eCt5izJKyCi4N4vKpxFIJsGYiagGBpJvQjPv0E3HHww58n-ixL2cPgDmdKMLTvVKs3AI5NBQrwu-mkzkB1EDKZtxQkrz_wuCKuNlnTWzBunx9mW4V7JZRG4-_1wlu9u3Rmq7u-4aIusBa4xDucv9mlCnY41rReVsJuYVpufem5htmy4gJenI0NJa0Ty_FAgy158vhYHp7C3LY_oignf2e5ZSVTZh8709ERzD7XaIfbvq3bkwqwvKhciP3OPIgvpYlcvMIGHKezDWmOPl00GqllKQ_2iO4Q8MBWRWkJpJpl05ZDlXww_FNdSa0Uqnvp9oE9Z6ke1zdoVUvILZCCtOxXS2Zts81O543TMSL5VwpUUhxRq70C7ZmCYYKk8_e07SB_FyGWDjVMVA3I5CdmRxKSE9S4PF3FFVa_rmwWKmjFMF1Jk72KVK_jLaV2GD4hbwO5W4IE6PnKWnwsQNBUHmv84jK3g2_ISBVj271hFlm8tPZAh9VB5wJ9SpdYrIgFYnFfGO647lhkQA8-Pec7PsHGlALG_Umh1ETEarcYU9eZqZ4GzeeGdGVjF-y1nI4_&timg=https%3A%2F%2Fss0.bdstatic.com%2F94oJfD_bAAcT8t7mm9GUKT-xh_%2Ftimg%3Fimage%26quality%3D100%26size%3Db4000_4000%26sec%3D1566992595%26di%3D7ce716c376753bdf7bd62bc708d10e7c%26src%3Dhttp%3A%2F%2Fpic2.zhimg.com%2F50%2Fv2-f34145b01ab1d5bb463cac35ddc9777d_hd.jpg&click_t=1566992598442&s_info=1903_937&wd=&eqid=9f3255e1000114c3000000025d6668d3");
//    picUrls.add("https://www.baidu.com/link?url=Vx579CpXsxGt7XXVJ0ni_cowmqff5M3eyQ8Nw3IwwsOziYKRxCzHjYFr6CiAhTtV5ImVN0Ha9Zf6BpFuRm3sKSMdsukZWLp0l9gs_zpVu9-jw7aeokqPj_BjsJ0fYbTxUQ_4IKYOAWCZxcLMaB_3-w2QEBMP2cIpBVB0Z9y3uoPtYH4QzL08qd1Kcc3ATM1k3jSn7a4nHnVhSAqMCsGqhI4Ard4gU0ogu0D1e6PIwahFiAJVMq4yKC5K-xliT_8dx-O_MZU7h8LqD5AEvxubjPO2kJs9qXev4M8fqYtbBELdPl6tEgm1VmzFW9B3Q-JMbeXTZPi1TsCrmqxqfjQ4UIjgNkv5h2SkG_x-AgyvFlppzBOPhZS7A6wsgzjS0toasRAW6ZYuL8VlYzr-0H27dsZMbfr6XpJ2PpfP6_SyorSdu5UIpI-rnevj3gZqjxbV21N1oIzXV8ejWziZGYu-RsxRjwlc_ePezJaAOsLwGgKaRilemiR1ilf8bBJmGlbQMqJu7Ag5E-SD-w6ShI8s5-4s7e1giG3gfVEh-AqOJXwP-cQTgPdb307fBmeuSf5l6TPqk2NUZi90KXxXrC5M6CBiF7CjyHGK0OfsuFTFBnUSihrRScK_qniVCTHGmyEi8F8Ak3IfiJiZN0g5wbQbo_&timg=https%3A%2F%2Fss0.bdstatic.com%2F94oJfD_bAAcT8t7mm9GUKT-xh_%2Ftimg%3Fimage%26quality%3D100%26size%3Db4000_4000%26sec%3D1566992595%26di%3D5ae7735486f9883f0a8aa39bf1c2b935%26src%3Dhttp%3A%2F%2Fimg5.duitang.com%2Fuploads%2Fitem%2F201407%2F28%2F20140728135735_w42HW.thumb.700_0.jpeg&click_t=1566992648232&s_info=1903_937&wd=&eqid=9f3255e1000114c3000000025d6668d3");
//    picUrls.add("https://www.baidu.com/link?url=QR7V4X8zb9OgSSWeHx-ONvk0x5xEwFyPOkf5SC-t6o0_D3EE0DajdDvlMkVkUpxl6V4LYhPFqE1QyiMJrYgMMPsa1ERlN2wEnbN4KO-rFiBqbTldRWHWuF-9egr5IUH7C-5FkCc19MnOySHk_6e_XgQoGDMID2b973LHShCJ2jRnnb3AYxYx0TPEiHhCNwzKMrFop2agRGPszywXtswr9UHvsivGP_hvyl52A2m7cpM2m1tFBYenszjiH3Y4xZzBqMDmF2NaTJxC4s-AnAy07gNjAlc5MWHSAP2a-SRSriqw-GVCnOiVUqJdqnW84NRVmZwGrAgEo5UKGUjYCom1IZQI510SKp2tpZVepxmlsFkxmYb_z6C4l7bqdSEPaaEnyHkw_9Gsrqvnbfka3hXUvTn6lEzS-FanTluPe_He9nR6QNbnoMaWBd3gVq5qrkyXr7-p9yycTi84WgDe0gPp-CqlKZo7pEgCt-u_6nR45F91Kl4YtGVv9rMrvQj5_EYjbYKsejiQQsPr2FcOoBvt6IpLlPPiU4bP8-Mv_f252ped0QJc4Z3hsCHP1Z0Ph-Vom6F-IqB86hkgh8-yTnv6Oq0UDZJLPnyT8ZfJlopoJeN8HkShXB8VS6lzgO6g8zs3ROBXU6DN1LNUYQddyFwSbcMen9PFD9iVSH2YoVmtMkm&timg=https%3A%2F%2Fss0.bdstatic.com%2F94oJfD_bAAcT8t7mm9GUKT-xh_%2Ftimg%3Fimage%26quality%3D100%26size%3Db4000_4000%26sec%3D1566992595%26di%3Daa96f06dd84d1327c022f82b78cb86ad%26src%3Dhttp%3A%2F%2Fimg3.duitang.com%2Fuploads%2Fitem%2F201504%2F02%2F20150402H2753_JuTG3.thumb.700_0.jpeg&click_t=1566992681884&s_info=1903_937&wd=&eqid=9f3255e1000114c3000000025d6668d3");
//    picUrls.add("https://www.baidu.com/link?url=rV04R6g4th7YBTWelAoLa8ZjKRfBqwp7Cpyv7cOEgibaHPg9Vc5tXuZLpzfKxic5uSVpQT3mTJzENlrLhbDrBx8SFAK0yfOjHKr32uj05N6_D1vRv8UDDuNT2k6m1ztsUWf1Ip6ChB6dp7A7_L2I2E-Q4_ms3Z_9-Ev3jb_TRH1pDM0MmpTIJRyZmebEpTkD20Tpz9mF07KvoI9500LJ5qpbNIfuXNL2WDleHijZrNgd7oNet_bmcVP4ETtz6mmWorduAfuNJX2YEWy8-nJ-by66_EiRCSMvH3I1NArCfVIHfP5LNCwnqPyuCUMuxdQmwTcq0xXxEnrIKniCSKGS4jeeUaU0u8Xnob17oGAGy4Bs8TT0OxabgRciqbeYLaauqplNMF-jRlQQ2CrlsjBUyit-K6Cl7lm3KgLV807ltTQxV1fLCGAOZPVTa6hu1XMiCh5X1WMxSxADvGsQ6_IMbzQMNzEHUDqgg4JJGG54Du4OopwyLYv4i9GDlIbfi9LoXna_vxJUMl1OvGFHUfCFC70S4YcKsRmNaBpfowd3JmoDLsjQpnVFlyzq7khBRsfkcZ45Lm1gFQgFzb5lU99r06yGxFtm_dUhy-MUKOqrZfC7ptHIKGVzR1Gk8oQX6RHPYdFZfMXm8txJpHc-xbSQYQI886WqNVSng_rFKxc4wIC&timg=https%3A%2F%2Fss0.bdstatic.com%2F94oJfD_bAAcT8t7mm9GUKT-xh_%2Ftimg%3Fimage%26quality%3D100%26size%3Db4000_4000%26sec%3D1566992595%26di%3Dbf360454b1161aa51948dd4a251ef9af%26src%3Dhttp%3A%2F%2Fimg4.duitang.com%2Fuploads%2Fitem%2F201407%2F22%2F20140722081210_m3EE8.jpeg&click_t=1566992689780&s_info=1903_937&wd=&eqid=9f3255e1000114c3000000025d6668d3");
//    picUrls.add("https://www.baidu.com/link?url=rV04R6g4th7YBTWelAoLatYaXMvscbg8mq1CgHrrw4mEIqEgtiSvKoB25IaZbJx3kBeNeLV_BLtlbdyFTDpfnlCwQKAWQcnRhgaFO_sEItGl1rgHvAZM96S7fYw_gZyraUhcWg71hvl4O3u1gqs0gzke-gNnrwK9eD0bUY4sHw0Gw6k49xo9AYzfclLxlBL-OSXMm0uk0ffLAZ1kZTOklCd17fkMUPHaBzjGdNLpaGkbRA-3Ys17ZnQDFa9UiJUsAA_bPLcmH4iUNP1MQmR_sKKO1gE7q2oWJsxsGiheAS2gYZU8NmDetOAkl__w8hd3HatvbLx-wHnY8yxVcriLBRabvCps4KTrbdBx2Cph-w7OnYsmUtp99eR1eUEVhtwmZtaRC2x-iWj7Id6hyup5HHCaoFC3Wc_ULdqEQO-k9sBoLcRPpq0ksRoXvaLFQEf2cyOgoBnyn3gKH7v_5bOnCp4EQQEctjWnVBJmhTar_htpeLM0MDmzol2W_DDD4DevOcD-hHvNyPd4Y_U7eOIJ89rjidgHeIlBch8bxwssjtB5Kf-IPRtnM4HQa5Lc3hzqv48KsMlu8BxLQWtfio64hWK5wpeWUL4WgLuLNzlcH2C88-2u3jkDUi7Qr4mRI-ccidWvMDi9534WIVtfvsvzFK_zDqHymTkvlnF6iaDfajUPjIQU2MeOHDpjUemgyW3N&timg=https%3A%2F%2Fss0.bdstatic.com%2F94oJfD_bAAcT8t7mm9GUKT-xh_%2Ftimg%3Fimage%26quality%3D100%26size%3Db4000_4000%26sec%3D1566992595%26di%3D260445ad3341a01c27568df1a52677b6%26src%3Dhttp%3A%2F%2Fwww.banyingle.com%2Fshop%2Fimages_shop%2F24622%2F2012-01-12%2F69872012112106083970703.jpg&click_t=1566992697753&s_info=1903_937&wd=&eqid=9f3255e1000114c3000000025d6668d3");
//    picUrls.add("https://www.baidu.com/link?url=-eBskCeEXUfwZtxmRdMkFv_86qnebiwo_FDZuiP35DizbehnCaLp-8W2izT1JwSEv25JSpQ6nTbG5rjJ6O9yAkfNFqcECOKiC3Kw9oJCQuTHZg-GU1tSEnov3Cd8DHGDpy7QJQQt_Ir6QVystLcE_eVwZ4CEtQsxUHf8qgR-otnr31jappOKd22AVj5-IZoes99up0ujntn9NmoiI3N9hkIGDKiAmpfneZ8YT_gV8s0pUpLXja49zyL07Y7yqb-mmD_hwuTteF0LOsC5DY_kZTzVdeOSvNj29PPIoBEA9rCeNU2BZZmFEr0eLBzjlLqc6IxlbXa9KQBbIrk5NLVTZUWtxPpk0S4jcuQhMz6WxLknDnEjFfmb2TakWYPaHvCRdLSYXlCqeckIAXuVcc-uI6behl78qOND8QMOC8rukq46FunxE6lDQAexlql4YXFPUQmapDvUmqiFIyVGZpLjeEGUQ8vthG-O2w7ADaUXv-_TnrZ3a25QXwqyJD0Iz2A4Maqc8PHHyQi3q7hGV4f6WUrF0DdaVWUw4Sh1Rjcsj1C2hz8LdcmiasxYKRndFAP5PeKdmknPiBRjD5mlrIKWqwszkCEO6SpcC51EJjMNulu2gRg427DGpjpF7AK-omcaV-TaH_3JCcQEabphqtNzjK&timg=https%3A%2F%2Fss0.bdstatic.com%2F94oJfD_bAAcT8t7mm9GUKT-xh_%2Ftimg%3Fimage%26quality%3D100%26size%3Db4000_4000%26sec%3D1566992595%26di%3D4051b0b9fc143f57bc1a907cf782bfa3%26src%3Dhttp%3A%2F%2Fimg5.duitang.com%2Fuploads%2Fitem%2F201410%2F11%2F20141011040700_3iXsj.thumb.700_0.jpeg&click_t=1566992702959&s_info=1903_937&wd=&eqid=9f3255e1000114c3000000025d6668d3");
//    picUrls.add("https://www.baidu.com/link?url=rV04R6g4th7YBTWelAoLatYaXMvscbg8mq1CgHrrw4mEIqEgtiSvKoB25IaZbJx3kBeNeLV_BLtlbdyFTDpfnlCwQKAWQcnRhgaFO_sEItGl1rgHvAZM96S7fYw_gZyraUhcWg71hvl4O3u1gqs0gzke-gNnrwK9eD0bUY4sHw13FDn1dGvLYkQbvSmTASD6huEZGA5B4mtWKRfIVEUpuK0AhB99SEKfAUr5k1TV-_8RzSvXnwrPtR_hGkhLwhU1mv-rpX_N3Qvm1Mnw0zIsEBRwx7h5NY086OeBc1pFH4NsHljrNCtS40EJs6wQRbn7HYnhZYne2fGvIyLc_4WGZoJYiuDbPuio5GUJkn5erCZynntH7ycLYs12G1wopYJ9VPckZGSvjDmB4w8x-yMupwvueEOc6cprB3IAwtBVWFal7zUHuC4VJFpPEo9YrVpaxIoK36ymof-af_7Lh6HgUWEISSpeYEBnxW9m-A6tRu1M6EA7GfNmrAIXkm3jLceupnWeVRCKqUqxhx3fjRqhfjvMFfv7gdLn_TOclzY9w7cjfKXlwOGFEBl3pm7LXVjfiuwRKmnJxT6VZHF7YAm_rwHfqEpiyDrcS-D1Y-Cunbfmdlitbt_QTX3rBmVYVosgj_LiJ8b5dnZ0__iqwJtpTKhao2Xr9CWpyCjoe-7KizK&timg=https%3A%2F%2Fss0.bdstatic.com%2F94oJfD_bAAcT8t7mm9GUKT-xh_%2Ftimg%3Fimage%26quality%3D100%26size%3Db4000_4000%26sec%3D1566992595%26di%3D22e5883d225164ae2f641a0f1c3ea6de%26src%3Dhttp%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201201%2F23%2F20120123180321_jxGPG.jpg&click_t=1566992711559&s_info=1903_937&wd=&eqid=9f3255e1000114c3000000025d6668d3");
//    picUrls.add("https://www.baidu.com/link?url=xs7htLLbEsDuMz4AenhLW6BzJII6vQ6rgoSDfttErpdG8GNc_X57DpFC5BXuLrKj72w_JDOilvsKmD_bZn_p4uODjhtsHuIWnTLAWpYqAB3ThhdLSIc_Jgpi2Fa7FQ8Fqs3ZHSYk6I4Bj2qd6RvU1wMw37c5fBlXj8yt_4L7NWMig-dXDSOqMN4jVcpVH_FzzeNtTv6Ya9mEq7_Z0g2_wTMFWSMTQTzVjY_6H11K7BjJTMIrlz2NS7gvQGAbDdc_kErAS8GYX30ahtIyNQ6-gSBm9wfe0UX7TY2CxodroKh13Pq6DXlj7ucv5QxMAsGMGaye7rATdVyv8okUoZJNkPchPX4UCj4HlqIcCFddD75-n7H9drhcLcoAaViF2Hhe4vOSuy9VGHO9UNgsDFr6Czd92RGf68NsTZshpX3XYx0-T3-jz-oCLc9q0wl5plkSISiRXAYZwabYO0yjGCRUP15uatSDvARoiahSdaPxUvMrd4qbzOmvj0twWwWOdrtLe1JkUSYzWronur5HBVnAmuZSf7vBJSKSW3tvTIuyK3Xxa3t2RLunoJb3jzLrWnElP-sGDhm-0EzOK8vogFfXkYvclpOqwjM960nN0yprdqZiiETRJOz4HxRJDo792xrY4CcihcFH0-qfXqqQcO3uLPlDjNgfmPn9sSO0JdOHawm&timg=https%3A%2F%2Fss0.bdstatic.com%2F94oJfD_bAAcT8t7mm9GUKT-xh_%2Ftimg%3Fimage%26quality%3D100%26size%3Db4000_4000%26sec%3D1566992595%26di%3D094aeb343bc29e49da37dc25233e378b%26src%3Dhttp%3A%2F%2Fimg4.duitang.com%2Fuploads%2Fitem%2F201112%2F19%2F20111219183951_HHRLG.thumb.700_0.jpg&click_t=1566992725298&s_info=1903_937&wd=&eqid=9f3255e1000114c3000000025d6668d3");
//    picUrls.add("https://www.baidu.com/link?url=xs7htLLbEsDuMz4AenhLW6BzJII6vQ6rgoSDfttErpdG8GNc_X57DpFC5BXuLrKj72w_JDOilvsKmD_bZn_p4uODjhtsHuIWnTLAWpYqAB3ThhdLSIc_Jgpi2Fa7FQ8Fqs3ZHSYk6I4Bj2qd6RvU1wMw37c5fBlXj8yt_4L7NWMig-dXDSOqMN4jVcpVH_FzzeNtTv6Ya9mEq7_Z0g2_wTMFWSMTQTzVjY_6H11K7BjJTMIrlz2NS7gvQGAbDdc_kErAS8GYX30ahtIyNQ6-gSBm9wfe0UX7TY2CxodroKh13Pq6DXlj7ucv5QxMAsGMGaye7rATdVyv8okUoZJNkPchPX4UCj4HlqIcCFddD75-n7H9drhcLcoAaViF2Hhe4vOSuy9VGHO9UNgsDFr6Czd92RGf68NsTZshpX3XYx0-T3-jz-oCLc9q0wl5plkSISiRXAYZwabYO0yjGCRUP15uatSDvARoiahSdaPxUvMrd4qbzOmvj0twWwWOdrtLe1JkUSYzWronur5HBVnAmuZSf7vBJSKSW3tvTIuyK3Xxa3t2RLunoJb3jzLrWnElP-sGDhm-0EzOK8vogFfXkYvclpOqwjM960nN0yprdqZiiETRJOz4HxRJDo792xrY4CcihcFH0-qfXqqQcO3uLPlDjNgfmPn9sSO0JdOHawm&timg=https%3A%2F%2Fss0.bdstatic.com%2F94oJfD_bAAcT8t7mm9GUKT-xh_%2Ftimg%3Fimage%26quality%3D100%26size%3Db4000_4000%26sec%3D1566992595%26di%3D094aeb343bc29e49da37dc25233e378b%26src%3Dhttp%3A%2F%2Fimg4.duitang.com%2Fuploads%2Fitem%2F201112%2F19%2F20111219183951_HHRLG.thumb.700_0.jpg&click_t=1566992725298&s_info=1903_937&wd=&eqid=9f3255e1000114c3000000025d6668d3");
    picUrls.add("http://qiniu.sishuxuefu.com/041bb610-111e-4d45-8a26-8db733371922");
    picUrls.add("http://qiniu.sishuxuefu.com/b49f258c-a848-4a2c-b275-f1ba7a35725c");
    picUrls.add("http://qiniu.sishuxuefu.com/7ead7b98-2f5f-46a4-9d11-cadd49c5c790");
    picUrls.add("http://qiniu.sishuxuefu.com/041bb610-111e-4d45-8a26-8db733371922");
    picUrls.add("http://qiniu.sishuxuefu.com/b49f258c-a848-4a2c-b275-f1ba7a35725c");
    picUrls.add("http://qiniu.sishuxuefu.com/7ead7b98-2f5f-46a4-9d11-cadd49c5c790");
    picUrls.add("http://qiniu.sishuxuefu.com/041bb610-111e-4d45-8a26-8db733371922");
    picUrls.add("http://qiniu.sishuxuefu.com/b49f258c-a848-4a2c-b275-f1ba7a35725c");
    picUrls.add("http://qiniu.sishuxuefu.com/7ead7b98-2f5f-46a4-9d11-cadd49c5c790");


    //调用工具类 生成九宫格 并保存在已有路径
    boolean flag = false;
    long start = System.currentTimeMillis();
    try {

      flag = ImageUtil.getCombinationOfhead(picUrls, dir, groupId);
    } catch (IOException e) {
      e.printStackTrace();
    }
    long end = System.currentTimeMillis();
    if (flag) {
      System.out.println("群头像生成成功,耗时:" + (end - start));
    }
  }

}
